package org.lztvn.elearning.entities;

import java.io.Serializable;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import org.hibernate.validator.constraints.NotEmpty;
import org.hibernate.validator.constraints.URL;

@Entity
@Table(name = "unit")
public class Unit implements Serializable{
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Long idUnit;
	@NotNull
	@Size(min=3)
	private String title;
	@Size(min=3)
	private String description;
	@URL
	private String uri_youtube;
	
	private Integer pos;
	
//	@OneToMany(mappedBy="unit",cascade = CascadeType.ALL)
//	private List<Question> quest;

//	@ManyToOne
//	@JoinColumn(name="idCourse")
//	private Course course;
	private Long idCourse;
	

	
	public Long getIdUnit() {
		return idUnit;
	}

	public void setIdUnit(Long idUnit) {
		this.idUnit = idUnit;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getUri_youtube() {
		return uri_youtube;
	}

	public void setUri_youtube(String uri_youtube) {
		this.uri_youtube = uri_youtube;
	}
	
	
//
//	public List<Question> getQuest() {
//		return quest;
//	}
//
//	public void setQuest(List<Question> quest) {
//		this.quest = quest;
//	}
//	
//	
//
//	public Course getCourse() {
//		return course;
//	}
//
//	public void setCourse(Course course) {
//		this.course = course;
//	}

	
	
	
	public Integer getPos() {
		return pos;
	}

	public Long getIdCourse() {
		return idCourse;
	}

	public void setIdCourse(Long idCourse) {
		this.idCourse = idCourse;
	}

	public void setPos(Integer pos) {
		this.pos = pos;
	}

	public Unit() {
		super();
		// TODO Auto-generated constructor stub
	}

	public Unit(String title, String description, String uri_youtube, Integer pos) {
		super();
		this.title = title;
		this.description = description;
		this.uri_youtube = uri_youtube;
		this.pos=pos;
	}
	
	
	
}
